<template>
    <div class="group_wrapper">
        <div class="com_item" v-for="card in cards" :key="card._id" :style="getShapeStyle(card.style)">
            <component :is="card.component" :initProp="card.cardJson.initProp" :comData="card.comData"></component>
        </div>
    </div>
</template>
<script setup>
import {
    computed
} from 'vue'
import { fillStyle } from "../pages/editor/utils/utils"
const props = defineProps({
    initProp: {
        type: Object,
        default() {
            return {}
        }
    }
})
const cards = computed(() => {
    return props.initProp.cards || []
})

const getShapeStyle = (style) => {
    return fillStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
}
</script>
<style lang="less" scoped>
.group_wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.com_item {
    position: absolute;
}
</style>